home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / shells / scsh-0.4 / scsh-0 / scsh-0.4.2 / Makefile.in < prev    next >
Makefile  |  1995-11-04  |  22KB  |  703 lines

  1. # Scheme Shell Makefile
  2. # Last updated October 1995 by BDC
  3.  
  4. # Documentation in files INSTALL and doc/install.txt
  5.  
  6. srcdir = @srcdir@
  7. VPATH = @srcdir@
  8. CC = @CC@
  9. DEFS = @DEFS@
  10. LIBS = @LIBS@
  11. #DBOPEN = @DBOPEN@
  12. CFLAGS = @CFLAGS@
  13. CPPFLAGS= @CPPFLAGS@ -I$(srcdir)/cig -I$(srcdir)/scsh/regexp
  14. INSTALL = @INSTALL@
  15. INSTALL_PROGRAM = @INSTALL_PROGRAM@ -c
  16. INSTALL_DATA = @INSTALL_DATA@ -c
  17.  
  18. LDFLAGS = -g @LDFLAGS@
  19. LDFLAGS_AIX= @LDFLAGS_AIX@
  20.  
  21. RM    = rm -f
  22.  
  23. AR    = @AR@
  24. RANLIB    = @RANLIB@
  25.  
  26. SHELL    = /bin/sh
  27.  
  28. prefix = @prefix@
  29. exec_prefix = @exec_prefix@
  30. bindir = $(exec_prefix)/bin
  31. libdir = $(exec_prefix)/lib
  32. incdir = $(exec_prefix)/include
  33. mandir = $(prefix)/man
  34. manext = 1
  35.  
  36. # HP 9000 series, if you don't have gcc
  37. #   CC = cc 
  38. #   CFLAGS = -Aa -O +Obb1800
  39. #   DEFS = -D_HPUX_SOURCE -Dhpux
  40.  
  41. # Ultrix
  42. #   LDFLAGS = -N
  43.  
  44. .c.o:
  45.     $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(CFLAGS) -o $@ $<
  46.  
  47. # You might want to change RUNNABLE to "s48" # NOT -bri
  48. RUNNABLE = scsh
  49. MANPAGE = $(RUNNABLE).$(manext)
  50. LIB = $(libdir)/$(RUNNABLE)
  51.  
  52. distdir = /users/ftp/pub/s48
  53. #distdir = /net/mini-wheats/fs/admin/ftp/pub/s48
  54.  
  55. # If make barfs on this include line, just comment it out.  It's only
  56. # really needed if you want to build the linker or rebuild initial.image.
  57. include $(srcdir)/filenames.make
  58. #
  59. # Berkeley make wants to see this instead: (or use GNU make on BSD. -bri)
  60. #.include "$(srcdir)/filenames.make"
  61.  
  62.  
  63. # Static linker:
  64. #
  65. # You only need the linker if you're going to make changes to the
  66. # things that go into the initial.image, which in general means the
  67. # files in rts/.  If you decide you need to use the linker, then you
  68. # gots your choice; it can run in just about any version of Scheme 48
  69. # or Pseudoscheme.  (It has also been made to run in Scheme->C.)  It
  70. # doesn't matter a whole lot which Scheme you use as long as it's not
  71. # broken or unavailable.  The two best choices are:
  72. # 1. As below: build the linker on the scheme48vm and scheme48.image
  73. #    that are in the current directory.
  74. # 2. LINKER_VM = $(RUNNABLE) $(BIG_HEAP)
  75. #    LINKER_RUNNABLE = $(RUNNABLE)
  76. #    These settings requires you to already have a $(RUNNABLE)
  77. #    command.  This is desirable if you are making changes to the
  78. #    system that might break scheme48vm and/or scheme48.image.  But it
  79. #    requires you to have squirreled away a previous working version
  80. #    of scheme48.
  81.  
  82. BIG_HEAP = -h 4000000
  83. LINKER_VM = ./$(VM) $(BIG_HEAP)
  84. LINKER_RUNNABLE = $(LINKER_VM) -i $(IMAGE)
  85. LINKER_IMAGE = link/linker.image
  86. LINKER = $(LINKER_VM) -i $(LINKER_IMAGE)
  87. START_LINKER = echo ,batch; echo ,bench on;
  88.  
  89.  
  90. # --------------------
  91. # You shouldn't have to change anything below this point.
  92.  
  93. # Targets:
  94.  
  95. IMAGE = scheme48.image
  96. INITIAL = $(srcdir)/initial.image
  97. VM = scshvm
  98. LIBCIG = cig/lib$(VM).a
  99. CIG = cig/cig
  100. CIGOBJS = cig/libcig.o cig/libcig1.o
  101. SCSHVMHACKS = proc2.o # postgcstub.o
  102.  
  103. SCSHOBJS = \
  104.     scsh/dirstuff1.o \
  105.     scsh/fdports1.o \
  106.     scsh/flock.o scsh/flock1.o \
  107.     scsh/jcontrol2.o scsh/jcontrol1.o \
  108.     scsh/machine/stdio_dep.o \
  109.     scsh/machine/time_dep1.o \
  110.     scsh/network.o scsh/network1.o \
  111.     scsh/putenv.o \
  112.     scsh/rdelim.o \
  113.     scsh/re.o scsh/re1.o \
  114.     scsh/regexp/regexp.o \
  115.     scsh/regexp/regsub.o \
  116.     scsh/select.o scsh/select1.o \
  117.     scsh/syscalls.o scsh/syscalls1.o \
  118.     scsh/time.o scsh/time1.o \
  119.     scsh/tty.o scsh/tty1.o \
  120.     scsh/userinfo1.o
  121.  
  122. #        scsh/$(DBOPEN) \
  123. #        scsh/dbm.o scsh/dbm1.o
  124.  
  125. OBJS = unix.o dynload.o prescheme.o extension.o scheme48vm.o \
  126.     $(CIGOBJS) $(SCSHVMHACKS) $(SCSHOBJS) 
  127.  
  128. # Sources:
  129.  
  130. CONFIG_FILES = interfaces.scm low-packages.scm rts-packages.scm \
  131.            comp-packages.scm
  132.  
  133. # Rules:
  134.  
  135. # The following is the first rule and therefore the "make" command's
  136. # default target.
  137. enough: $(VM) $(IMAGE) script $(LIBCIG) scsh $(MANPAGE) .notify
  138.  
  139. # The developers are curious to know.  Don't be concerned if this fails.
  140. # You may comment these lines out if you wish to be discourteous.
  141. .notify: minor-version-number
  142.     touch .notify
  143.     -echo SCSH 0.`cat $(srcdir)/scsh/minor-version-number` \
  144.        Scheme48 0.`cat $(srcdir)/minor-version-number` infestation. \
  145.        | mail scheme-48-notifications@martigny.ai.mit.edu 
  146.     -echo Another scsh 0.`cat $(srcdir)/scsh/minor-version-number` \
  147.     infestation. | mail scsh-notifications@martigny.ai.mit.edu 
  148.  
  149. # This says how to process .scm files with cig to make .c stubs.
  150. .SUFFIXES: .scm
  151. .scm.c:
  152.     $(srcdir)/$(VM) -o $(srcdir)/$(VM) -i $(CIG) < $< > $*.c
  153.  
  154. # These .h files mediate between the code exported from foo1.c
  155. # and imported into foo.scm's stub foo.c.
  156.  
  157. scsh/dirstuff1.o: scsh/dirstuff1.h
  158. scsh/rdelim.o:    scsh/fdports1.h
  159. scsh/userinfo1.o: scsh/userinfo1.h
  160.  
  161. scsh/fdports1.o      scsh/fdports.o:  scsh/fdports1.h
  162. scsh/flock1.o      scsh/flock.o:       scsh/flock1.h
  163. scsh/network1.o      scsh/network.o:  scsh/network1.h
  164. scsh/re1.o      scsh/re.o:       scsh/re1.h
  165. scsh/select1.o      scsh/select.o:   scsh/select1.h
  166. scsh/syscalls1.o  scsh/syscalls.o: scsh/syscalls1.h
  167. scsh/time1.o      scsh/time.o:       scsh/time1.h
  168. scsh/tty1.o       scsh/tty.o:       scsh/tty1.h
  169.  
  170. scsh/syscalls.o:  scsh/syscalls1.h scsh/dirstuff1.h scsh/fdports1.h \
  171.           scsh/select1.h   scsh/userinfo1.h
  172.  
  173. include $(srcdir)/scsh/machine/Makefile.inc
  174. # Berkeley make wants to see this instead: (or use GNU make on BSD. -bri)
  175. #.include "$(srcdir)/scsh/machine/Makefile.inc"
  176.  
  177. $(VM): main.o $(OBJS) $(AIX_P)
  178.     $(CC) $(LDFLAGS) $(LDFLAGS_AIX) -o $@ main.o $(OBJS) $(LIBS)
  179.  
  180. $(LIBCIG): main.o $(OBJS)
  181. #    $(CC) -r -o $@ main.o $(OBJS)
  182.     $(RM) $@
  183.     $(AR) $@ main.o $(OBJS) 
  184.     $(RANLIB) $@
  185.  
  186. main.o: main.c
  187.     $(CC) -c -o $@ -DDEFAULT_IMAGE_NAME=\"$(LIB)/scsh.image\" \
  188.         $(CPPFLAGS) $(CFLAGS) $(srcdir)/main.c
  189. scheme48vm.o: scheme48vm.c prescheme.h
  190. extension.o: extension.c sysdep.h scheme48.h
  191. unix.o: unix.c sysdep.h
  192. dynload.o: dynload.c sysdep.h scheme48.h
  193.  
  194. # --------------------
  195. # Make scheme48.image from initial.image and library .scm files.
  196. #
  197. # In the following, "make" passes $$USER to the shell as $USER, which
  198. # the shell sees as an environment variable reference.
  199. #
  200. # For bootstrap reasons, initial.image is *not* listed as a source,
  201. # even though it really is.
  202.  
  203. $(IMAGE): $(VM) env/init-defpackage.scm more-interfaces.scm link-packages.scm \
  204.        more-packages.scm $(usual-files) initial.debug build-usual-image
  205.     sh $(srcdir)/build-usual-image "$(srcdir)" "$(LIB)" "$(IMAGE)" \
  206.        "$(VM)" "$(INITIAL)"
  207.  
  208. # Unix man page...
  209.  
  210. $(MANPAGE): scsh.man Makefile
  211.     sed 's=LBIN=$(bindir)=g' $(srcdir)/scsh.man \
  212.      | sed 's=LLIB=$(LIB)=g' \
  213.      | sed 's=LSCSH=$(RUNNABLE)=g' >$@
  214.     -chmod +r $@
  215.  
  216. script:
  217.     (echo '#!/bin/sh'; \
  218.      echo exec '$(LIB)/$(VM)' -o '$(LIB)/$(VM)' -i '$(LIB)/$(IMAGE)' \"\$$\@\") \
  219.        > script
  220.     -chmod +x script
  221.  
  222. ### Fake targets:  all clean install man dist
  223.  
  224. install: install-dirs install-vm install-misc \
  225.     install-man install-inc install-cig install-scsh
  226.  
  227. #install: script install-dirs install-vm install-image install-misc \
  228. #    install-man install-inc install-cig install-scsh
  229. #    This is now install-scsh
  230. #    $(INSTALL_PROGRAM) script $(bindir)/$(RUNNABLE)
  231.  
  232. install-dirs:
  233.     if [ ! -d $(prefix) ] ; then mkdir $(prefix); fi
  234.     if [ ! -d $(exec_prefix) ] ; then mkdir $(exec_prefix); fi
  235.     if [ ! -d $(bindir) ] ; then mkdir $(bindir); fi
  236.     if [ ! -d $(libdir) ] ; then mkdir $(libdir); fi
  237.     if [ ! -d $(incdir) ] ; then mkdir $(incdir); fi
  238.     if [ ! -d $(mandir) ] ; then mkdir $(mandir); fi
  239.     if [ ! -d $(mandir)/man$(manext) ] ; then mkdir $(mandir)/man$(manext); fi
  240.     $(RM) -r $(LIB).old
  241.     if [ -d $(LIB) ] ; then mv $(LIB) $(LIB).old ; fi
  242.     mkdir $(LIB)
  243.     mkdir $(LIB)/big
  244.     mkdir $(LIB)/cig
  245.     mkdir $(LIB)/doc
  246.     mkdir $(LIB)/doc/scsh-manual
  247.     mkdir $(LIB)/env
  248.     mkdir $(LIB)/link
  249.     mkdir $(LIB)/misc
  250.     mkdir $(LIB)/opt
  251.     mkdir $(LIB)/scsh
  252.     mkdir $(LIB)/rts
  253.     mkdir $(LIB)/vm
  254.  
  255. install-vm: $(VM)
  256.     $(INSTALL_PROGRAM) $(VM) $(LIB)/
  257.  
  258. install-image: $(IMAGE)
  259.     $(INSTALL_DATA) $(IMAGE) $(LIB)/
  260.  
  261. install-man: $(MANPAGE)
  262.     if test -d $(mandir)/man$(manext);  \
  263.       then $(INSTALL_DATA) $(MANPAGE) $(mandir)/man$(manext); \
  264.           else echo "No man directory, not installing man page"; fi
  265.  
  266. install-inc: scheme48.h
  267.     $(INSTALL_DATA) $(srcdir)/scheme48.h $(incdir)/
  268.  
  269. install-cig: cig
  270.     $(INSTALL_PROGRAM) $(srcdir)/$(CIG) $(LIB)/cig
  271.     $(INSTALL_PROGRAM) $(srcdir)/$(CIG).image $(LIB)/cig
  272.     $(INSTALL_DATA) $(srcdir)/$(LIBCIG) $(LIB)/cig
  273.     $(INSTALL_DATA) $(srcdir)/cig/libcig.h $(LIB)/cig
  274.  
  275. install-misc: $(LIB)/rts $(LIB)/env $(LIB)/big $(LIB)/opt \
  276.           $(LIB)/misc $(LIB)/link $(LIB)/vm $(LIB)/doc
  277.     for f in $(srcdir)/rts/*num.scm; \
  278.         do $(INSTALL_DATA) $$f $(LIB)/rts/; done
  279.     for f in $(srcdir)/env/*.scm; do $(INSTALL_DATA) $$f $(LIB)/env/; done
  280.     for f in $(srcdir)/big/*.scm; do $(INSTALL_DATA) $$f $(LIB)/big/; done
  281.     for f in $(srcdir)/opt/*.scm; do $(INSTALL_DATA) $$f $(LIB)/opt/; done
  282.     for f in $(srcdir)/misc/*.scm; \
  283.         do $(INSTALL_DATA) $$f $(LIB)/misc/; done
  284.     for f in $(srcdir)/link/*.scm; \
  285.         do $(INSTALL_DATA) $$f $(LIB)/link/; done
  286.     for f in $(srcdir)/vm/*.scm; do $(INSTALL_DATA) $$f $(LIB)/vm/; done
  287.     for f in $(srcdir)/doc/*.txt; do $(INSTALL_DATA) $$f $(LIB)/doc/; done
  288.     for f in $(srcdir)/doc/*.tex; do $(INSTALL_DATA) $$f $(LIB)/doc/; done
  289.     for f in $(srcdir)/doc/*.ps; do $(INSTALL_DATA) $$f $(LIB)/doc/; done
  290.     for f in $(srcdir)/doc/scsh-manual/*.tex; \
  291.         do $(INSTALL_DATA) $$f $(LIB)/doc/scsh-manual/; done
  292.     $(INSTALL_DATA) $(srcdir)/rts/jar-defrecord.scm $(LIB)/rts/
  293. #  -p: Intermediate directories are created as necessary.
  294. # -p not portable...it is POSIX 2, bit its not widely available -bri
  295. # just added install-dirs
  296. $(LIB)/rts:
  297.     mkdir $(LIB)/rts
  298. $(LIB)/env:
  299.     mkdir $(LIB)/env
  300. $(LIB)/opt:
  301.     mkdir $(LIB)/opt
  302. $(LIB)/big:
  303.     mkdir $(LIB)/big
  304. $(LIB)/misc:
  305.     mkdir $(LIB)/misc
  306. $(LIB)/link:
  307.     mkdir $(LIB)/link
  308.  
  309. configure: configure.in
  310.     cd $(srcdir); autoconf
  311.  
  312. clean: clean-scsh
  313.     -rm -f $(VM) *.o TAGS $(IMAGE) *.tmp script $(MANPAGE) \
  314.         link/*.image debug/*.image debug/*.debug mini mini-heap.c \
  315.         cig/*.o $(CIG) $(CIG).image $(LIBCIG)
  316.     -find . -name "*~" -o -name ".#*"  -o -name core -exec rm {} \;
  317.  
  318. distclean: clean
  319.     $(RM) Makefile sysdep.h config.status config.log config.cache \
  320.         scsh/machine scsh/regexp/Makefile scsh/endian.scm \
  321.         exportlist.aix
  322.  
  323. man:    $(MANPAGE)
  324.  
  325. check:    $(VM) $(IMAGE) debug/check.scm
  326.     (echo ,translate =scheme48/ $(srcdir)/; \
  327.      echo ,config ,load $(srcdir)/debug/test.scm; \
  328.      echo ,exec ,load $(srcdir)/debug/check.scm; echo ,exec "(done)") \
  329.     | ./$(VM) -o ./$(VM) -i $(IMAGE) batch
  330.  
  331. # --------------------
  332. # Rules from here on down are not essential for the basic installation
  333. # procedure, and are not expected to work when srcdir is not the
  334. # distribution directory.
  335.  
  336. all: vm linker
  337.     $(MAKE) image
  338. vm: $(VM)
  339. linker: $(LINKER_IMAGE)
  340. image: $(INITIAL)
  341.     $(MAKE) $(IMAGE)
  342.  
  343. tags:
  344.     etags scsh/*.scm scsh/*.c \
  345.       rts/*.scm bcomp/*.scm *.scm env/*.scm big/*.scm \
  346.       link/*.scm opt/*.scm debug/*.scm misc/*.scm \
  347.       vm/*.scm
  348.  
  349. # --------------------
  350. # Increment the minor version number
  351. inc:
  352.     (cat minor-version-number; echo 1+p) | dc >minor-version-number.tmp
  353.     mv minor-version-number.tmp minor-version-number
  354.     echo \(define version-info \"0.`cat minor-version-number`\"\) \
  355.       >env/version-info.scm
  356.  
  357.  
  358. # --------------------
  359. # Generate filenames.make from *packages.scm
  360. #
  361. # This hack traces the module dependencies described in the
  362. # various configuration files and converts them into dependency lists
  363. # that "make" can use for its purposes.
  364. #
  365. # Since the distribution comes with a filenames.make, this rule
  366. # shouldn't be invoked for simple installations.  But it will be used
  367. # if you change any of the *-packages.scm files.
  368. #
  369. # You can actually the forms in filenames.scm to any Scheme
  370. # implementation that has syntax-rules and explicit-renaming low-level
  371. # macros (e.g., most versions of Scheme 48 and Pseudoscheme).
  372. # If there are errors running this script, and you need to debug,
  373. # don't use the initial.image, use something that has a reasonable
  374. # environment.
  375. #
  376. # If this fails and you don't feel like debugging or fixing the problem,
  377. # try "touch filenames.make" and hope for the best.
  378.  
  379. PACKAGES=packages.scm rts-packages.scm alt-packages.scm \
  380.         comp-packages.scm initial-packages.scm link-packages.scm \
  381.         more-packages.scm filenames.scm
  382.  
  383. filenames.make: $(PACKAGES)
  384.     $(MAKE) $(VM) PACKAGES=
  385.     ./$(VM) -o ./$(VM) -i $(INITIAL) batch <filenames.scm
  386. # or:    $(RUNNABLE) -s filenames.scm
  387.  
  388. # --------------------
  389. # Static linker
  390. #
  391. # The linker is capable of rebuilding an image from sources, even
  392. # across an incompatible change in VM data representations.
  393.  
  394. link/linker.image: $(linker-files) alt/init-defpackage.scm
  395.     (echo ,batch; echo ,bench on;                  \
  396.      echo ,open signals handle features;           \
  397.      echo ,open bitwise ascii code-vectors record; \
  398.      echo ,load $(linker-files);               \
  399.      echo ,load alt/init-defpackage.scm;           \
  400.      echo ,dump link/linker.image)               \
  401.     | $(LINKER_RUNNABLE)
  402.  
  403. # Or, to bootstrap from Lucid Common Lisp: (last tested with
  404. # Pseudoscheme 2.9 and Scheme 48 version 0.19)
  405.  
  406. PSEUDODIR = ../pseudo
  407.  
  408. link/linker-in-lucid: link/lucid-script.lisp $(linker-files) \
  409.         alt/pseudoscheme-features.scm alt/pseudoscheme-record.scm
  410.     (echo \(defvar pseudoscheme-directory \"$(PSEUDODIR)/\"\); \
  411.      cat link/lucid-script.lisp; \
  412.      echo \(dump-linker\) \(lcl:quit\)) \
  413.     | lisp
  414.  
  415. # --------------------
  416. # Initial image
  417. #
  418. # The initial.image is built by the static linker.  The image contains
  419. # Scheme, the byte-code compiler, and a minimal command processor, but
  420. # no debugging environment to speak of.
  421.  
  422. $(INITIAL): $(LINKER_IMAGE) $(CONFIG_FILES) initial.scm $(initial-files) \
  423.     scsh/scsh-read.scm scsh/here.scm # gross and Olin hates it -bri
  424.     ($(START_LINKER)               \
  425.      echo \(load-configuration \"interfaces.scm\"\); \
  426.      echo \(load-configuration \"packages.scm\"\); \
  427.      echo \(flatload initial-structures\); \
  428.      echo \(load \"initial.scm\"\);  \
  429.      echo \(link-initial-system\))   \
  430.     | $(LINKER)
  431.  
  432. # --------------------
  433. # Various small images for debugging low-level changes
  434.  
  435. LOAD_DEBUG = \
  436.      $(START_LINKER) \
  437.      echo \(load-configuration \"interfaces.scm\"\); \
  438.      echo \(load-configuration \"packages.scm\"\); \
  439.      echo \(flatload debug-structures\)
  440.  
  441. debug/tiny.image: $(LINKER_IMAGE) debug/tiny-packages.scm debug/tiny.scm
  442.     ($(START_LINKER) \
  443.      echo \(load-configuration \"debug/tiny-packages.scm\"\); \
  444.      echo \(link-simple-system \'\(debug tiny\) \'start tiny-system\)) \
  445.     | $(LINKER)
  446.  
  447. debug/little.image: $(LINKER_IMAGE) $(CONFIG_FILES) debug-packages.scm
  448.     ($(LOAD_DEBUG); echo \(link-little-system\)) \
  449.     | time $(LINKER)
  450.  
  451. debug/mini.image: $(LINKER_IMAGE) $(CONFIG_FILES)
  452.     ($(LOAD_DEBUG); echo \(link-mini-system\)) \
  453.     | $(LINKER)
  454.  
  455. debug/medium.image: $(LINKER_IMAGE) $(CONFIG_FILES)
  456.     ($(LOAD_DEBUG); echo \(flatload compiler-structures\); \
  457.      echo \(link-medium-system\)) \
  458.     | $(LINKER)
  459.  
  460. smain.o: main.c
  461.     $(CC) -c $(CPPFLAGS) $(CFLAGS) -DSTATIC_AREAS -o $@ $(srcdir)/main.c
  462.  
  463. mini: mini-heap.o smain.o
  464.     $(CC) $(LDFLAGS) -o $@ smain.o mini-heap.o $(OBJS) $(LIBS)
  465. mini-heap.o: mini-heap.c
  466.     $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $(srcdir)/mini-heap.c
  467. mini-heap.c: debug/mini1.image
  468.     (echo ,batch on; \
  469.      echo ,exec ,load misc/load-static.scm; \
  470.      echo \(do-it 150000 \"$(srcdir)/debug/mini1.image\" \"$@\"\)) \
  471.     | ./$(VM) -o ./$(VM) -h 3000000  -i $(IMAGE)
  472. debug/mini1.image: $(VM) debug/mini.image
  473.     echo "(write-image \"debug/mini1.image\" \
  474.                (usual-resumer (lambda (args) \
  475.                         (command-processor #f args))) \
  476.                \"foo\")" \
  477.     | ./$(VM) -i debug/mini.image
  478.  
  479. # --------------------
  480. # Generate scheme48.h from VM sources
  481.  
  482. scheme48.h: vm/arch.scm vm/data.scm link/generate-c-header.scm
  483.     (echo ,bench; \
  484.      echo ,load-package big-scheme; echo ,open big-scheme; \
  485.      echo ,load link/generate-c-header.scm; \
  486.      echo \(make-c-header-file \"$@\" \
  487.                    \"$(srcdir)/vm/arch.scm\" \"$(srcdir)/vm/data.scm\"\)) \
  488.     | $(RUNNABLE) -s-
  489.  
  490. #scheme48vm.c: $(vm-files)
  491. #    prescheme $(srcdir)/vm/compile-vm
  492.  
  493. cig: $(CIG) $(CIG).image $(LIBCIG)
  494.  
  495. $(CIG): $(VM) $(IMAGE) $(srcdir)/cig/cig.scm $(srcdir)/cig/libcig.scm
  496.     (echo ",batch"; \
  497.      echo ",translate =scheme48/ $(srcdir)/"; \
  498.      echo ",config ,load $(srcdir)/cig/cig.scm"; \
  499.      echo ",config ,load $(srcdir)/cig/libcig.scm"; \
  500.      echo ",load-package cig-standalone"; \
  501.      echo ",in cig-standalone"; \
  502.      echo ",translate =scheme48/ $(LIB)/"; \
  503.      echo ",build cig-standalone-toplevel /tmp/cig") \
  504.     | ./$(VM) -i ./$(IMAGE)
  505.     $(srcdir)/cig/image2script $(LIB)/$(VM) </tmp/cig > $(CIG)
  506.     -chmod +x $(CIG)
  507.     $(RM) /tmp/cig
  508.  
  509. $(CIG)2:
  510.     (echo ",batch"; \
  511.      echo ",translate =scheme48/ $(srcdir)/"; \
  512.      echo ",config ,load $(srcdir)/cig/cig2.scm"; \
  513.      echo ",config ,load $(srcdir)/cig/libcig.scm"; \
  514.      echo ",load-package cig-standalone"; \
  515.      echo ",in cig-standalone"; \
  516.      echo ",translate =scheme48/ $(LIB)/"; \
  517.      echo '(dump-scsh-program cig-standalone-toplevel "/tmp/cig")') \
  518.     | ./$(VM) -o ./$(VM) -i ./scsh/scsh.image
  519.     $(srcdir)/cig/image2script $(LIB)/$(VM) </tmp/cig > $(CIG)2
  520.     -chmod +x $(CIG)2
  521.     $(RM) /tmp/cig
  522.  
  523. $(CIG).image: $(IMAGE) $(VM) $(srcdir)/cig/cig.scm $(srcdir)/cig/libcig.scm
  524.     (echo ",batch"; \
  525.      echo ",translate =scheme48/ $(srcdir)/"; \
  526.      echo ",config ,load $(srcdir)/cig/cig.scm"; \
  527.      echo ",config ,load $(srcdir)/cig/libcig.scm"; \
  528.      echo ",load-package cig-aux"; \
  529.      echo ",open define-foreign-syntax"; \
  530.      echo ",translate =scheme48/ $(LIB)/"; \
  531.      echo ",dump /tmp/cig \"(CIG Preloaded -bri)\"") \
  532.     | ./$(VM) -o ./$(VM) -i ./$(IMAGE)
  533.     $(srcdir)/cig/image2script $(LIB)/$(VM) \
  534.             -o $(LIB)/$(VM) \
  535.             </tmp/cig > $(CIG).image
  536.     -chmod +x $(CIG).image
  537.     $(RM) /tmp/cig
  538.  
  539. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  540. # SCSH Specifics
  541. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  542. scsh: cig scsh/scsh scsh/scsh.image
  543.  
  544. SCHEME =scsh/awk.scm \
  545.     scsh/char-set.scm \
  546.     scsh/defrec.scm \
  547.     scsh/endian.scm \
  548.     scsh/enumconst.scm \
  549.     scsh/fdports.scm \
  550.     scsh/fileinfo.scm \
  551.     scsh/filemtch.scm \
  552.     scsh/filesys.scm \
  553.     scsh/flock.scm \
  554.     scsh/fname.scm \
  555.     scsh/fr.scm \
  556.     scsh/glob.scm \
  557.     scsh/here.scm \
  558.     scsh/machine/bufpol.scm \
  559.     scsh/machine/errno.scm \
  560.     scsh/machine/fdflags.scm \
  561.     scsh/machine/netconst.scm \
  562.     scsh/machine/packages.scm \
  563.     scsh/machine/signals.scm \
  564.     scsh/machine/time_dep.scm \
  565.     scsh/machine/tty-consts.scm \
  566.     scsh/machine/waitcodes.scm \
  567.     scsh/meta-arg.scm \
  568.     scsh/network.scm \
  569.     scsh/newports.scm \
  570.     scsh/procobj.scm \
  571.     scsh/pty.scm \
  572.     scsh/rdelim.scm \
  573.     scsh/re.scm \
  574.     scsh/rw.scm \
  575.     scsh/scsh-condition.scm \
  576.     scsh/scsh-interfaces.scm \
  577.     scsh/scsh-package.scm \
  578.     scsh/scsh-read.scm \
  579.     scsh/scsh-version.scm \
  580.     scsh/scsh.scm \
  581.     scsh/select.scm \
  582.     scsh/startup.scm \
  583.     scsh/stringcoll.scm \
  584.     scsh/syntax-helpers.scm \
  585.     scsh/syntax.scm \
  586.     scsh/syscalls.scm \
  587.     scsh/time.scm \
  588.     scsh/top.scm \
  589.     scsh/tty.scm \
  590.     scsh/utilities.scm
  591.  
  592. #        scsh/dbm.scm db.scm ndbm.scm
  593. #    static.scm static-heap.scm static1.scm
  594. #    jcontrol
  595.  
  596. # Bogus, but it makes the scm->c->o two-ply dependency work.
  597. # Explicitly giving the .o/.c dependency also makes it go.
  598. ############################################################
  599. cig/libcig.c:        cig/libcig.scm
  600. scsh/flock.c:        scsh/flock.scm
  601. scsh/jcontrol2.c:    scsh/jcontrol2.scm
  602. scsh/network.c:        scsh/network.scm
  603. scsh/rdelim.c:        scsh/rdelim.scm
  604. scsh/re.c:        scsh/re.scm
  605. scsh/select.c:            scsh/select.scm
  606. scsh/syscalls.c:    scsh/syscalls.scm
  607. scsh/tty.c:        scsh/tty.scm
  608. scsh/time.c:        scsh/time.scm
  609.  
  610. scsh/scsh: scsh/scsh-tramp.c
  611.     $(CC) -o $@ $(CPPFLAGS) $(CFLAGS) \
  612.     -DVM=\"$(LIB)/$(VM)\" \
  613.     -DIMAGE=\"$(LIB)/scsh.image\" \
  614.     scsh/scsh-tramp.c
  615.  
  616. scsh/scsh.image: $(VM) $(SCHEME) $(CIG).image
  617.     (echo ",translate =scheme48/ $(srcdir)/"; \
  618.      echo ",batch on"; \
  619.      echo ",open externals"; \
  620.      echo "(lookup-all-externals)"; \
  621.      echo ",config"; \
  622.      echo ",load $(srcdir)/scsh/scsh-interfaces.scm"; \
  623.      echo ",load $(srcdir)/scsh/machine/packages.scm"; \
  624.      echo ",load $(srcdir)/scsh/scsh-package.scm"; \
  625.      echo ",user"; \
  626.      echo ",load-package scsh"; \
  627.      echo ",load-package scsh-here-string-hax"; \
  628.      echo ",open scsh"; \
  629.      echo ",translate =scheme48/ $(LIB)/"; \
  630.      echo "(dump-scsh \"scsh/scsh.image\")") \
  631.     | ./$(VM) -o ./$(VM) -i $(CIG).image
  632.  
  633. # Removed these lines from scsh/scsh.image rule so you don't lose so
  634. # badly when you are debugging in scsh. -Olin 6/95
  635. #     echo ",flush";
  636. #     echo ",flush maps source names files table";
  637.  
  638. #scsh/scsh.runnable: scsh/scsh.image
  639. #    cig/image2script $(LIB)/$(VM) -o $(LIB)/$(VM) -h 1800000 \
  640. #        < scsh/scsh.image > $@
  641. #    -chmod +x $@
  642.  
  643. scsh/regexp/libregexp.a:
  644.     cd scsh/regexp; $(MAKE)
  645.  
  646. # SCSH static heaps
  647. .SUFFIXES: .scm .image .a .vm
  648.  
  649. .image.a:
  650.     $(RM) $@
  651.     (echo ",batch on"; \
  652.      echo ",config ,load vm/ps-interface.scm"; \
  653.      echo ",config ,load vm/interfaces.scm"; \
  654.      echo ",config ,load vm/package-defs.scm"; \
  655.      echo ",config ,load vm/s48-package-defs.scm"; \
  656.      echo ",load-package bigbit"; \
  657.      echo ",load-package destructuring"; \
  658.      echo ",load-package heap"; \
  659.      echo ",in heap"; \
  660.      echo "(define (newspace-begin) *newspace-begin*)"; \
  661.      echo "(define (heap-pointer) *hp*)"; \
  662.      echo ",structure heap-extra (export newspace-begin"; \
  663.      echo "                  heap-pointer"; \
  664.      echo "                  header-a-units"; \
  665.      echo "                  d-vector? "; \
  666.      echo "                  stob-type)"; \
  667.      echo ",config"; \
  668.      echo "(define-structure static (export scsh-do-it"; \
  669.      echo "                 test"; \
  670.      echo "                 do-it)"; \
  671.      echo "  (open scheme heap memory data stob struct"; \
  672.      echo "    heap-extra"; \
  673.      echo "    vm-architecture"; \
  674.      echo "    formats"; \
  675.      echo "    enumerated"; \
  676.      echo "    signals"; \
  677.      echo "    tables"; \
  678.      echo "    defrec-package"; \
  679.      echo "    externals"; \
  680.      echo "    scsh)"; \
  681.      echo "  (files (scsh static)))"; \
  682.      echo ",user"; \
  683.      echo ",load-package static"; \
  684.      echo ",open static"; \
  685.      echo \(scsh-do-it \"$<\" \"/homes/bdc/tmp\" \"$@\" \
  686.                \"$(CC) -c\" \"$(AR)\" \)) \
  687.     | ./$(VM) -o ./$(VM) -h 4000000  -i scsh/scsh.image
  688.     $(RANLIB) $@
  689.  
  690. .a.vm:
  691.     $(CC) $(LDFLAGS) -o $@ smain.o $< $(OBJS) $(LIBS)
  692.  
  693. install-scsh: scsh
  694.     $(RM) $(bindir)/$(RUNNABLE)
  695.     $(INSTALL_PROGRAM) $(srcdir)/scsh/scsh $(bindir)/$(RUNNABLE)
  696.     $(INSTALL_PROGRAM) $(srcdir)/scsh/scsh.image $(LIB)/scsh.image
  697.     for f in $(srcdir)/scsh/*.scm; \
  698.         do $(INSTALL_DATA) $$f $(LIB)/scsh/; done
  699.  
  700. clean-scsh:
  701.     $(RM) scsh/*.o scsh/regexp/*.o scsh/*.image scsh/scsh install
  702.     -cd scsh/regexp; $(MAKE) clean
  703.